package cn.itcast.day02.demo;

public class person {
    String name;
    private int age;
    public void show(){
        System.out.println("我叫" + name + "我今年" + age + "岁了");
    }
    public void setAge(int num ) {
        if (num > 0 && num < 100) {
            age = num;
        }else {
            System.out.println("输入数据错误");
        }
    }
    public int getAge(){
        return age;
    }

}
